/*
 * @Author: Aaron Huang
 * @Date: 2022-10-19 14:09:52
 * @LastEditors: Aaron Huang
 * @LastEditTime: 2022-11-16 14:28:46
 * @Description: file content
 * @FilePath: \ias_ui\src\views\coi\CBEC\js\modifyListPageParams.js
 * @Company: 沃尔玛
 */
import moment from 'moment'
import { modifyStatus as mainStatusList } from './dictionary'
import { filterKey } from '@/utils/processingData'

export const searchList = [
  { label: '商品编号', searchType: 'el-input', searchKey: 'itemNbrList', type: 'textarea', placeholder: '请输入商品编号，多个回车换行隔开', clearable: true },
  {
    label: 'UPC(无校验位)',
    searchType: 'el-input',
    searchKey: 'skuList',
    type: 'textarea',
    placeholder: '请输入UPC(无校验位)，多个回车换行隔开',
    clearable: true
  },
  { label: '部门', searchType: 'el-input', searchKey: 'deptNbr', type: 'textarea', placeholder: '请输入部门，多个回车换行隔开' },
  { label: '任务状态', searchType: 'el-select', searchKey: 'mainStatusList', clearable: true, multiple: true, 'collapse-tags': true },
  { label: '商品名称', searchType: 'el-input', searchKey: 'skuName', maxlength: 50, clearable: true },
  {
    label: '创建时间',
    searchType: 'el-date-picker',
    searchKey: 'createByDate',
    type: 'datetimerange',
    clearable: true,
    'value-format': 'yyyy-MM-dd HH:mm:ss',
    format: 'yyyy-MM-dd'
  },
  {
    label: '更新时间',
    searchType: 'el-date-picker',
    searchKey: 'updateByDate',
    type: 'datetimerange',
    clearable: true,
    'value-format': 'yyyy-MM-dd HH:mm:ss',
    format: 'yyyy-MM-dd'
  }
]

export const options = {
  mainStatusList
}
export const tableColumns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left'
  },
  {
    label: '商品编号',
    'min-width': 100,
    prop: 'itemNbr'
  },
  {
    label: '商品名称',
    'min-width': 100,
    prop: 'skuName'
  },
  {
    label: 'UPC(不带校验位)',
    'min-width': 120,
    prop: 'sku',
    slotName: 'sku'
  },
  {
    label: '部门',
    'min-width': 80,
    prop: 'deptNbr'
  },
  {
    label: '供应商号',
    'min-width': 80,
    prop: 'buildVendorNbr'
  },
  {
    label: '任务状态',
    'min-width': 100,
    prop: 'mainStatus',
    formatter: (row, column, cellValue, index) => {
      return filterKey(cellValue, mainStatusList)
    }
  },
  {
    label: '创建时间',
    'min-width': 120,
    prop: 'createdTime',
    formatter: (row, column, cellValue, index) => {
      return moment(cellValue).format('YYYY-MM-DD HH:mm:ss')
    }
  },
  {
    label: '更新人',
    'min-width': 100,
    prop: 'updatedBy'
  },
  {
    label: '更新时间',
    'min-width': 120,
    prop: 'updatedTime',
    formatter: (row, column, cellValue, index) => {
      return moment(cellValue).format('YYYY-MM-DD HH:mm:ss')
    }
  },
  {
    label: '操作',
    width: 100,
    slotName: 'operation',
    fixed: 'right'
  }
]
